<?php

namespace app\common\model;

use app\common\RootModel;

class FeedbackModel extends RootModel
{
    protected $pk = 'id';
    protected $table = 'sys_member_feedback';

    /**
     * 状态
     * @var string[]
     */
    public static $stateLabel = ['待回复', '已回复', '已查看', '已处理'];

    /**
     * 其它语言状态方法
     * @return array
     */
    public static function stateLabel()
    {
        return [lang('no reply'), lang('replied')];
    }

    protected function getIconAttr($val)
    {
        return json_decode($val, true);
    }

    protected function setIconAttr($val)
    {
        return json_encode(explode('|', $val));
    }
}